projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96587f7
)
(pbm_load): Correctly check image size for greyscale pbm.
author
Chong Yidong
<cyd@stupidchicken.com>
Sat, 12 May 2007 23:53:57 +0000
(23:53 +0000)
committer
Chong Yidong
<cyd@stupidchicken.com>
Sat, 12 May 2007 23:53:57 +0000
(23:53 +0000)
src/image.c
patch
|
blob
|
history
diff --git
a/src/image.c
b/src/image.c
index b8317b1e9826b771405ed652e0faaa0f116852dc..eacea4a1d972dbd1db47a23b811056ca47e008d6 100644
(file)
--- a/
src/image.c
+++ b/
src/image.c
@@
-5742,9
+5742,13
@@
pbm_load (f, img)
}
else
{
- if (raw_p && (p + 3 * height * width > end))
+ if (raw_p
+ && ((type == PBM_GRAY)
+ ? (p + height * width > end)
+ : (p + 3 * height * width > end)))
{
x_destroy_x_image (ximg);
+ x_clear_image (f, img);
image_error ("Invalid image size in image `%s'",
img->spec, Qnil);
goto error;